package test;

abstract class Book
{
  int bookPage;
  float discount;
  double price;
public Book(int bookpage, float discount)
{
  this.bookPage=bookpage;
  this.discount=discount;
}
  abstract void show_kind();
  abstract double getPrice(int bookpage, float discount);
public void show_price()
{
System.out.println("This book's price is "+price);	
}
}
class Science_book extends Book
{
	public Science_book(int bookpage,float discount)
	{
	super(bookpage,discount);
    }
	public void show_kind()
	{
		System.out.println("The book's kind is science");
		}
	public double getPrice(int bookpage,float discount)
	{
		return bookpage*0.1*discount;
	}
	}
class Literature_book extends Book
{
	public Literature_book(int bookpage,float discount)
	{
		super(bookpage,discount);
		}
	public void show_kind()
	{
		System.out.println("The book's kind is literature");
	}
	public double getPrice(int bookpage,float discount)
	{
		return bookpage*0.08*discount;
	}
		}
class Teaching_book extends Book
	{
	public Teaching_book(int bookpage,float discount)
	{
		super(bookpage,discount);
	}
	public void show_kind()
	{
		System.out.println("The book kind's is teaching book");
	}
	public double getPrice(int bookpage, float discount)
	{
		return bookpage*0.05*discount;
	}
}


